<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0" >
	
	<xsl:template match="/canss">
	
		<html>
			<body>
				<h1>
					Feed List			
				</h1>
				<xsl:template match="canssPerson_Person">
					<table class="datatable">
						<tbody>
							<th scope='col'>Owner</th>
							<th scope='col'><center>No</center></th>
							<th scope='col'>FeedUri</th>
							<th scope='col'>Feed Rule</th>
							<th scope='col'>Feed Rule 관리</th>
							<th scope='col'>할당된 모듈 ID</th>
							<!-- <th scope='col'>Feed Status</th>
							<th scope='col'>Feed Status Description</th> -->
							<th scope='col'>Feed 관리</th>
							
							<xsl:for-each select="canssPerson_Person">
								<xsl:variable name="curpid"><xsl:value-of select="canssPerson_id"/></xsl:variable>
								<xsl:for-each select="canssFeed_feedlist/canssFeed_feed">
									<tr>
										<xsl:variable name="v_index"><xsl:number format="1"/></xsl:variable>
										<td class="singleentry">
											<!--  <xsl:value-of select="/canss/canssPerson_Person/canssPerson_id"/>-->
											<xsl:value-of select="$curpid"/>
										</td>
										<td scope='col'>
											<center><xsl:value-of select="$v_index"/></center>
										</td>
										<td>
											<xsl:variable name="v_feeduri" select="canssTrace_feeduri"/>
											<a href="{$v_feeduri}" target="_blank" style="cursor:pointer" onmouseover="this.style.color='red'" onmouseout="this.style.color=''">
												<xsl:value-of select="canssTrace_feeduri"/>
											</a>
										</td>
										<td class="singleentry">
												<xsl:if test="true()=canssTrace_ruleid/text()">
													<xsl:variable name="v_ruleid" select="canssTrace_ruleid/text()" />
													<p title="{$v_ruleid}"><xsl:value-of select="canssTrace_rulename"/></p>
												</xsl:if>
												<xsl:if test="true()!=canssTrace_ruleid/text()">
													- 미등록 -
												</xsl:if>
										</td>
										<td class="singleentry">
											<!-- rule 관리 -->
										
											<xsl:if test="true()=//canssFeed_feedlist/canssFeed_feed">
														<form id="frm_rulemanager_{$curpid}{$v_index}" method="post" action="http://mediator.canss.net/MetadataManager/RuleManager.php" target="_blank">
														<xsl:variable name="pid"><xsl:value-of select="$curpid"/></xsl:variable>
														<xsl:variable name="feeduri"><xsl:value-of select="canssTrace_feeduri"/></xsl:variable>
															<input type="hidden" name="_feed" value="{$feeduri}"/>
															<input type="hidden" name="_cpid" value="{$pid}"/>
															<input 
																class="maxsize"
																onclick="var frm=getobj('frm_rulemanager_{$curpid}{$v_index}');if(!frm)return;window.open('','pop_rulemanager','width=740,height=850');frm.target='pop_rulemanager';frm.submit();" 
																type="button" value="Rule관리"/>
														</form>
											</xsl:if>
											 
										</td>
										<td>
											<xsl:value-of select="canssTrace_ProviderModuleID"/>
										</td>
										<!--<td>
											<xsl:value-of select="canssTrace_feedstatus"/>
										</td>
										<td>
											<xsl:value-of select="canssTrace_feedstatusdesc"/>
										</td> -->
										<td class="singleentry">
											<xsl:choose>
												<xsl:when test="canssTrace_feeduri!=''">
													<xsl:variable name="pid"><xsl:value-of select="$curpid"/></xsl:variable>
													<xsl:variable name="mid"><xsl:value-of select="canssTrace_ProviderModuleID"/></xsl:variable>
													<xsl:variable name="feeduri"><xsl:value-of select="canssTrace_feeduri"/></xsl:variable>
													<a href="svtAjaxDeleteFeed?_pid={$pid}&amp;_mid={$mid}&amp;_feeduri={$feeduri}&amp;_rurl=mainframe.jsp?_pagenum=5">삭제</a>
											 	</xsl:when>
											 	<xsl:otherwise>
											 	</xsl:otherwise>
											 </xsl:choose>
										</td>
									</tr>
								</xsl:for-each>
							</xsl:for-each>
							
							<tr>
								<td>-</td>
								<td></td>
								<td colspan="5" style="text-align:right;">
									<form method="post" action="svtAjaxAddFeed">
											<xsl:variable name="pid"><xsl:value-of select="/canss/canssPerson_Person/canssPerson_id"/></xsl:variable>
											CPID:<input type="text" name="_pid" value="{$pid}"/>
											FeedURI: <input type="text" name="_feeduri"  style="width:40%"/>
											<input type="hidden" name="_rurl" value="mainframe.jsp?_pagenum=5"/>
											<input type="submit" value="추가" onclick=""/>
									</form>
								</td>
							</tr>	
						</tbody>				
					</table>
				</xsl:template>
			</body>
		</html>
	</xsl:template> 
</xsl:stylesheet>